/**
 * Created by xiaohui on 2017/4/10.
 */
var login = {
    check : function () {
        var username = $('input[name="username"]').val();
        var password = $('input[name="password"]').val();
        if(!username){
            dialog.error('用户名不能为空');
        }
        if(!password){
            dialog.error('密码不能为空');
        }
        $.ajax({
            type: "post",
            url: "__URL__/Index/check",
            data: {'username':username,'password':password},
            dataType: "json",
            //dataType:json,
            error: function (data) {
                alert(1);
                alert(data);

            },
            success: function (data) {
                alert(1);

            }
        });
    }
}